﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using YArchitech.Revit;

namespace HangerSupport
{
	public class HSCalResult
	{
		public HSCalResult(Element eleHS, UIApplication uiApp)
		{
			this.m_uiApp = uiApp;
			this.m_doc = this.m_uiApp.ActiveUIDocument.Document;
			Document doc = this.m_doc;
			this.m_eleHS = eleHS;
			HSDraw hsdraw = new HSDraw(uiApp);
			this.m_hsDefine = hsdraw.GetElementHSDefine(this.m_eleHS);
			this.m_nLinkDeviceNumRect = 0L;
			this.m_nLinkDeviceNumCircle = 0L;
			this.m_nSameNum = 1L;
			this.m_lstBarList = new List<HSCalBarInfo>();
			bool flag = this.m_hsDefine.m_eLinkDevice1 == HSLinkDevice.kLinkDeviceRect;
			if (flag)
			{
				this.m_nLinkDeviceNumRect += 1L;
			}
			else
			{
				bool flag2 = this.m_hsDefine.m_eLinkDevice1 == HSLinkDevice.kLinkDeviceCircle;
				if (flag2)
				{
					this.m_nLinkDeviceNumCircle += 1L;
				}
			}
			bool flag3 = this.m_hsDefine.m_eLinkDevice2 == HSLinkDevice.kLinkDeviceRect;
			if (flag3)
			{
				this.m_nLinkDeviceNumRect += 1L;
			}
			else
			{
				bool flag4 = this.m_hsDefine.m_eLinkDevice2 == HSLinkDevice.kLinkDeviceCircle;
				if (flag4)
				{
					this.m_nLinkDeviceNumCircle += 1L;
				}
			}
			bool flag5 = this.m_hsDefine.m_eLinkDevice3 == HSLinkDevice.kLinkDeviceRect;
			if (flag5)
			{
				this.m_nLinkDeviceNumRect += 1L;
			}
			else
			{
				bool flag6 = this.m_hsDefine.m_eLinkDevice3 == HSLinkDevice.kLinkDeviceCircle;
				if (flag6)
				{
					this.m_nLinkDeviceNumCircle += 1L;
				}
			}
			this.m_hsDefine.GetHSFamilyName(ref this.m_strHSType, ref this.m_strHSName, this.m_uiApp);
			this.m_strHSLabel = this.m_eleHS.GetParameter("整体编号").AsString();
			bool flag7 = this.m_eleHS.GetParameter("显示位置").AsInteger() == 0;
			if (flag7)
			{
				this.m_strHSLabel = "";
			}
			double num = 0.0;
			this.m_lstBarList = this.m_hsDefine.CalHSLength(ref num);
			this.m_strSizeInfo = this.m_hsDefine.GetSizeString();
			bool flag8 = num > 0.0;
			if (flag8)
			{
				this.m_strSizeInfo = this.m_strSizeInfo + "H" + num.ToString("f0");
			}
			this.m_strLinkType = "";
			bool flag9 = this.m_hsDefine.m_eType == HSType.kZJ_DC || this.m_hsDefine.m_eType == HSType.kZJ_PX || this.m_hsDefine.m_eType == HSType.kZJ_SJ || this.m_hsDefine.m_eType == HSType.kZJ_DZ || this.m_hsDefine.m_eType == HSType.kDJ_DC || this.m_hsDefine.m_eType == HSType.kDJ_PX || this.m_hsDefine.m_eType == HSType.kDJ_SL || this.m_hsDefine.m_eType == HSType.kDJ_ZJ || this.m_hsDefine.m_eType == HSType.kDJ_DC3 || this.m_hsDefine.m_eType == HSType.kDJ_PX3 || this.m_hsDefine.m_eType == HSType.kDJ_DZ;
			if (flag9)
			{
				this.m_strLinkType = "(" + this.m_hsDefine.GetLinkTypeName() + ")";
			}
			this.m_strHSName += this.m_strLinkType;
		}

		private UIApplication m_uiApp;

		private Document m_doc;

		private Element m_eleHS;

		public string m_strHSName;

		public string m_strHSType;

		public string m_strSizeInfo;

		public string m_strHSLabel;

		public long m_nLinkDeviceNumRect;

		public long m_nLinkDeviceNumCircle;

		public long m_nSameNum;

		public string m_strLinkType;

		public List<HSCalBarInfo> m_lstBarList;

		public HSDefineInfo m_hsDefine;
	}
}
